<template>
	<view>
		<u-tabs inactive-color="#000" :list="tabs" :is-scroll="false" v-model="curTab" :active-color="appTheme.mainBg"
			:duration="0.2" @change="onChangeTab" />
		<div class="box" v-if="list.length">
			<div class="item" v-for="(item,index) in list" :key="index">
				<div class="top">
					<div class="left">
						<div class="avatar">
							<avatar-image :url="item.avatar" :width="108" />
						</div>
						<div class="info">
							<div class="name">{{item.username}}</div>
							<div class="time">{{item.time}}</div>
						</div>
					</div>
					<div class="right">
						<u-icon name="edit-pen"></u-icon>
						<u-icon name="trash"></u-icon>
					</div>
				</div>
				<div class="bottom">
					<view class="u-line-2">
						{{item.content}}
					</view>
					<div class="imgs" v-if="item.imgs&&item.imgs.length" >
						<image v-for="(img,indexs) in item.imgs" :key="indexs"  :src="img" mode=""></image>
					</div>
				</div>
			</div>
		</div>
		<div v-else style="padding-top: 100rpx;">
			<u-empty margin-top="50rpx" mode="list"></u-empty>
		</div>
	</view>
</template>

<script>
	import AvatarImage from '@/components/avatar-image'
	export default {
		components: {
			AvatarImage
		},
		data() {
			return {
				tabs: [{
						name: `全部帖子`,
						value: 'all'
					},
					{
						name: `新鲜趣事`,
						value: 'a1'
					},
					{
						name: `晒单评价`,
						value: 'a2'
					},
					{
						name: `好物推荐`,
						value: 'a4'
					},
				],
				list: [{
					avatar: "https://b2c.oozetking.cn/uploads/10001/20240728/3e9a1bfd9dd0bbdba65d7147b7f04945.jpg",
					username: '0717号',
					time: '2022.05.13 12:32',
					content: '黄埔文冲博物馆“2022年生物多样性保护,黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护',
					imgs: ['https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png']
				},{
					avatar: "https://b2c.oozetking.cn/uploads/10001/20240728/3e9a1bfd9dd0bbdba65d7147b7f04945.jpg",
					username: '0717号',
					time: '2022.05.13 12:32',
					content: '黄埔文冲博物馆“2022年生物多样性保护,黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护',
					imgs: ['https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png']
				},{
					avatar: "https://b2c.oozetking.cn/uploads/10001/20240728/3e9a1bfd9dd0bbdba65d7147b7f04945.jpg",
					username: '0717号',
					time: '2022.05.13 12:32',
					content: '黄埔文冲博物馆“2022年生物多样性保护,黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护黄埔文冲博物馆“2022年生物多样性保护',
					imgs: ['https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png','https://b2c.oozetking.cn/uploads/10001/20240726/3dc00e2495700408f95facf78a2ccc49.png']
				},],
				curTab: 'all',
			};
		},
		methods: {
			onChangeTab() {

			}
		},
		onPullDownRefresh() {
			uni.stopPullDownRefresh()
		}
	}
</script>

<style lang="scss">
.box{
	background-color: #fff;
	border-radius: 24rpx 24rpx 0rpx 0rpx;
	margin-top: 32rpx;
	padding: 40rpx 20rpx;
	.item{
		margin-bottom: 24rpx;
		.bottom{
			.imgs{
				display: flex;
				align-items: center;
				>image{
					width: 218rpx;
					height: 218rpx;
					border-radius: 8rpx;
					margin-right: 8rpx;
				}
			}
		}
		.top{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 24rpx;
			.right{
				>view{
					margin-right: 10rpx;
				}
			}
			.left{
				display: flex;
				align-items: center;
				.avatar{
					margin-right: 24rpx;
				}
				.info{
					 .name{
						 font-weight: bold;
						 font-size: 40rpx;
						 color: #333030;
						 margin-bottom: 16rpx;
					 }
					 .time{
						 font-weight: 500;
						 font-size: 24rpx;
						 color: #999091;
					 }
				}
				
			}
		}
	}
}
</style>